<?xml version='1.0' encoding='UTF-8' ?> 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" 
      xmlns:f="http://java.sun.com/jsf/core" 
      xmlns:h="http://java.sun.com/jsf/html" 
      xmlns:p="http://primefaces.prime.com.tr/ui"
      xmlns:ez="http://java.sun.com/jsf/composite/ezcomp"> 
    <!--
    Author Randall Chia
    -->
    <h:head> 
        <title>IOTR</title> 
        <link rel="stylesheet" type="text/css" href="CSS/RandallCSS.css" />
        <style type="text/css"> 
            .gritter-notice-wrapper { 
                left:200px; 
                top:50px; 
            } 
        </style> 

    </h:head> 
    <h:body>                
        <ez:OutletManagerIOTRHeaderMenu/>

        <h1>Integrated Online Ticketing and Reservation (IOTR)- Outlet Manager Portal</h1> 

        <ez:OutletManagerIOTRMenu/> 

        <p:layout style="table-layout:auto; height:600px ">
            <p:layoutUnit position="left" header="Navigation" width="300">
                
            </p:layoutUnit>
                
            <p:layoutUnit position="center" header="Settings">
                
                
                <b>Reward Voucher Redemption</b><br/>
                            <div class ="contentbox">
                                        <h:form id="form_voucherRedeem">
                                                <br/>
                                                <br/>
                                                Input Customer Email: <p:inputText value="#{rewardMB.customerEmail}"/>  <p:commandButton value="Get Vouchers" action="OutletManager/IOTR_RewardRedemption.xhtml" ajax="false"/>
                                                <br/>
                                                <br/>
                                                <p:dataTable value="#{rewardMB.getCustomerVouchers()}" var="o"
                                                     styleClass="order-table-shoppingcart"
                                                     rowStyleClass="contentbox"
                                                     emptyMessage="No vouchers to display"
                                                     >
                                                        

                                                    <p:column style="width: 10px">
                                                        <f:facet name="header">ID</f:facet>
                                                        #{o.id}
                                                    </p:column>
                                                    
                                                    
                                                    <p:column style="width: 50px">
                                                        <f:facet name="header">Name</f:facet>
                                                        #{o.reward_Name}
                                                    </p:column>

                                                    <p:column style="width: 80px">
                                                        <f:facet name="header">Description</f:facet>
                                                        <h:outputText value="#{o.reward_Description}" escape="false"/>
                                                        
                                                    </p:column>

                                                    <p:column style="width: 40px">
                                                        <f:facet name="header">Points Cost</f:facet>
                                                        #{o.reward_Cost}
                                                    </p:column>
                                                    
                                                    <p:column style="width: 40px">
                                                        <f:facet name="header">Purchase Date</f:facet>
                                                        #{o.purchaseDate}
                                                    </p:column>

                                                    <p:column style="width: 50px">                    
                                                        <p:commandButton value="Redeem" action="#{rewardMB.redeemVoucher(o.id)}" ajax="false"/>
                                                    </p:column>


                                                </p:dataTable>

                                        </h:form>   
                                </div>
                
                
                
                
            </p:layoutUnit>
            
        </p:layout>

    </h:body> 
</html>